package com.yuyue.springFramework.note11.entity.custom1;

/**
 * 注册用户注册bean
 */
public class UserRegisterService {
    private EventMulticaster eventMulticaster;

    //注册用户方法
    public void registerUser(String userName){
        //模拟用户信息落库
        System.out.println(String.format("用户【%s】注册成功", userName));

        //使用事件广播器，广播事件进行处理
        this.eventMulticaster.multicasterEvent(new UserRegisterSuccessEvent(this, userName));
    }

    public EventMulticaster getEventMulticaster() {
        return eventMulticaster;
    }

    public void setEventMulticaster(EventMulticaster eventMulticaster) {
        this.eventMulticaster = eventMulticaster;
    }
}
